package com.jash.himalaya.entities;

import android.databinding.Observable;
import android.databinding.ObservableField;
import android.databinding.ObservableInt;
import android.support.v4.view.PagerAdapter;
import android.util.Log;

import com.google.gson.annotations.Expose;
import com.jash.himalaya.BR;
import com.jash.himalaya.R;
import com.jash.himalaya.utils.CommentPagerAdapter;

import java.util.List;

/**
 * Created by jash
 * Date: 16-1-20
 * Time: 上午10:32
 */
public class FocusImages {
    private String title;
    private List<FocusImageEntity> list;
    @Expose(serialize = false, deserialize = false)
    private PagerAdapter adapter;
    @Expose(serialize = false, deserialize = false)
    private ObservableInt currentPage = new ObservableInt(0);
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public List<FocusImageEntity> getList() {
        return list;
    }

    public void setList(List<FocusImageEntity> list) {
        this.list = list;
    }

    public PagerAdapter getAdapter() {
        if (adapter == null) {
            adapter = new CommentPagerAdapter<>(list, R.layout.focus_image, BR.image);
        }
        return adapter;
    }

    public ObservableInt getCurrentPage() {
        return currentPage;
    }
}
